from api.ihrm_api import IhrmApi
from common.token_util import TokenUtil


class DeptIdUlit:
    @classmethod
    def get_dept_id(cls):
        # 获取令牌
        token = TokenUtil.get_token()
        # 添加部门
        body = {"name": "猪猪侠", "code": "007"}
        add_resp = IhrmApi.ihrm_add_dept(token, body)
        dept_id = add_resp.json().get("data").get("id")
        return dept_id


# if __name__ == '__main__':
#     print(DeptIdUlit.get_dept_id())